﻿var status = 0;
var minLevel = 175;
var maxLevel = 250;
var minPartySize = 1;
var maxPartySize = 6;
var maxMegnice1 = 1;
var objDate=new Date();
var day=objDate.getDay();

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0 && status == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1) status++;
        else status--;
        if (status == 0) {
            cm.sendSimple("#e以簽到天數:"+cm.getNTD()+"天\r\n#e要進行簽到嗎??\r\n#b#L0#簽到")
        } else if (status == 1) {
            if (selection == 0) {
                if (cm.getBossLog("" +day+ "") < 20 && cm.getLevel() >= 10) { // 
                    cm.setBossLog("" +day+ "");
                    cm.giveNTD(1);
                    cm.gainItem(4031312, 20);
                    cm.gainItem(5062000, 50);//奇幻方塊
                    cm.sendOk("以領取每日獎勵。");
cm.worldSpouseMessage(0x07, "[連續簽到] : 玩家【"+cm.getChar().getName()+"】連續"+cm.getNTD()+"天簽到，獲取了丰厚的獎勵");
                    cm.dispose();
                        
                } else{ // 不是隊長
                    cm.sendOk("以領取過或等級未到達120等。");
                    cm.dispose();
                 } 
        }
    }
}
}